﻿@model IEnumerable<Cargo>

<div class="w-100 card border-0 p-4">
    <div class="card-header bg-success bg-gradient m-lg-0 py-3">
        <div class="row">
            <div class="col-12 text-center">
                <h2 class="text-white py-2">货物列表</h2>
            </div>
        </div>
    </div>
    <div class="card-body border p-4">
        <div class="row pb-3">
            <div class="col-6 offset-6 text-end">
                <a asp-controller="Cargo" asp-action="Create" class="btn btn-secondary">
                    <i class="bi bi-plus-circle"></i> 创建货物
                </a>
            </div>
        </div>

        <table class="table table-bordered table-striped">
            <thead>
                <tr>
                    <th>供应商</th>
                    <th>货物代码</th>
                    <th>货物名称</th>
                    <th>品牌</th>
                    <th>规格型号</th>
                    <th>HSCode</th>
                    <th>单价</th>
                    <th>计量单位</th>
                     <th>货币</th>
                    <th>包装</th>
                    <th>体积</th>
                    <th>长</th>
                    <th>宽</th>
                    <th>高</th>
                    <th>毛重</th>
                    <th>净重</th>
                   <th>安全库存</th>
                    <th>最大库存</th>
                    <th>创建时间</th> 
                    <th></th>
                </tr>
            </thead>
            <tbody>
                @foreach (var obj in Model)
                {
                    <tr>
                        <td>@obj.Supplier.Name</td>
                        <td>@obj.CargoCode</td>
                        <td>@obj.CargoName</td>
                        <td>@obj.Brand</td>
                        <td>@obj.Spcf</td>
                        <td>@obj.HSCode</td>
                        <td>@obj.Price</td>
                        <td>@obj.Unit</td>
                        <td>@obj.Curr</td>
                        <td>@obj.Package</td>
                        <td>@obj.Vol</td>
                        <td>@obj.Length</td>
                        <td>@obj.Width</td>
                        <td>@obj.Height</td>
                        <td>@obj.GrossWt</td>
                        <th>@obj.NetWt</th>
                        <td>@obj.MinNum</td>
                        <td>@obj.MaxNum</td>
                        <td>@obj.CreatedTime</td> 
                        <td>
                            <div class="w-75 btn-group" role="group">
                                <a asp-controller="Cargo" asp-action="Update" asp-route-cargoId="@obj.Id" class="btn btn-success mx-2">
                                    <i class="bi bi-pencil-square"></i> 编辑
                                </a>
                                <a asp-controller="Cargo" asp-action="Delete" asp-route-cargoId="@obj.Id" class="btn btn-danger mx-2">
                                    <i class="bi bi-trash-fill"></i> 删除
                                </a>
                            </div>
                        </td>
                    </tr>
                }
            </tbody>

        </table>
    </div>
</div>


